package com.example.beikeyigou.utils;

import android.content.Context;

import java.io.File;

public class URLUtils {
    // 内网公共部分
//    public static String PUBLIC_URL = "http://192.168.13.143:8080/beikeMarket";
    // 外网公共部分
    public static String PUBLIC_URL = "http://47.100.26.130:8085/beikeMarket";

    /* 用户相关 */
    // 1.注册接口
    public static String register_url = PUBLIC_URL + "/user/register";
    // 2.登录接口
    public static String login_url = PUBLIC_URL + "/user/login";
    // 3.更新/完善个人信息
    public static String updateInfo_url = PUBLIC_URL + "/user/updateInfo";
    // 4.显示密保问题
    public static String showQuestion_url = PUBLIC_URL + "/user/showQuestion";
    // 5.验证密保答案
    public static String verifyAnswer_url = PUBLIC_URL + "/user/verifyAnswer";
    // 6.更新密码
    public static String updatePwd_url = PUBLIC_URL + "/user/updatePwd";

    /* 业务相关 */
    // 1.查询所有的分类
    public static String queryAllCategory_url = PUBLIC_URL + "/biz/queryAllCategory";
    // 2.通过分类查询对应的产品
    public static String queryCommodityByCateId_url = PUBLIC_URL + "/biz/queryCommodityByCateId?categoryId=";
    // 3.商品模糊查询
    public static String queryCommodityByName_url = PUBLIC_URL + "/biz/queryCommodityByName?name=";
    // 4.商品详情
    public static String queryCommodityInfo_url = PUBLIC_URL + "/biz/queryCommodityInfo?commodityId=";
    // 5.热销产品
    public static String hotCommodity_url = PUBLIC_URL + "/biz/hotCommodity";
    // 6.产品推荐
    public static String recommendCommodity_url = PUBLIC_URL + "/biz/recommendCommodity";
    // 7.猜你喜欢
    public static String guessYouLike_url = PUBLIC_URL + "/biz/guessYouLike";

    /* 购物车相关 */
    // 1.添加购物车
    public static String insertShoppingCar_url = PUBLIC_URL + "/trade/insertShoppingCar";
    // 2.查询购物车
    public static String queryShoppingCar_url = PUBLIC_URL + "/trade/queryShoppingCar";
    // 3.购物车中商品下单支付
    public static String orderShopping_url = PUBLIC_URL + "/trade/orderShopping";
    // 4.直接购买（不进入购物车）
    public static String insertBought_url = PUBLIC_URL + "/trade/insertBought";
    // 5.查询已购买的商品
    public static String querybougth_url = PUBLIC_URL + "/trade/querybougth";


    // 保存在本地的头像信息
    public static String getImgPath(Context context, String name) {
        String path = context.getExternalCacheDir() + File.separator + name + ".jpg";
        return path;
    }
}
